package io;

import java.io.FileOutputStream;
import java.io.IOException;


public class FOSDemo {
    public static void main(String[] args) throws IOException {
        //向当前项目目录下的fos.dat文件里写入数据

        FileOutputStream fos = new FileOutputStream("./fos.dat");


        fos.write(1);

        fos.write(2);
        System.out.println("写出完毕!");

        //流用完了应当关闭
        fos.close();
    }
}
